//require
var Sequelize = require('sequelize');
var config = require('../config');
var sequelize = new Sequelize(config.db);
exports.sequelize = sequelize;
var CONST = require('./CONST');
// models

//============================项目===============================
var project = require('./project');
var Project = sequelize.define("Project", project.Project, {
  tableName: 'cases_case',
  timestamps: false
});


//============================项目详情===============================
var projectdetail = require('./project');
var ProjectDetail = sequelize.define("ProjectDetail", projectdetail.ProjectDetail, {
  tableName: 'cases_case',
  timestamps: false
});


// Question.belongsTo(Account,{
//   foreignKey: {
//     name: 'account_id',
//     allowNull: false
//   }
// })

// Subject.hasMany(Question, {
//   foreignKey: {
//     name: 'subject_id',
//     allowNull: false
//   }
// })

exports.Project = Project 
exports.ProjectDetail = ProjectDetail 


// create tables
// sequelize.sync();
// sequelize.sync({
//     force: true
// }) // drop al tables if exist and re-create
